package com.example.zhifubao.entity;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data

public class PayResultOrderVo {

    public PayResultOrderVo(boolean flag, String out_trade_no, String trade_no, String total_amount) {
        this.flag =flag;
        this.out_trade_no = out_trade_no;
        this.trade_no = trade_no;
        this.total_amount = total_amount;
    }

        private boolean flag = false;

        //商户订单号
        private String out_trade_no;

        //支付宝交易号
        private  String trade_no ;

        //付款金额
        private String total_amount;

        private   String msg;

        public PayResultOrderVo(String msg) {
            this.msg = msg;
        }

        public static PayResultOrderVo success(String out_trade_no, String trade_no, String total_amount){
                return new PayResultOrderVo(true,out_trade_no,trade_no,total_amount);
            }


        public PayResultOrderVo(boolean flag, String msg) {
            this.flag = flag;
            this.msg = msg;
        }

        public static PayResultOrderVo error(String msg){
                    return new PayResultOrderVo(false,msg);

        }

        public boolean isSuccess(){
            return this.flag;
        }

}


